package com.hitqz.robot.api.dispatch.model;

/**
 * 接受到服务端的数据
 * @author xupkun
 * @date 2024/5/30
 */
public class MessageDto {


    /**
     * 固定头部
     */
    private byte[] header;


    /**
     * 消息序列号
     */
    private int sn;

    /**
     * 命令
     */
    private short cmd;

    /**
     * 数据长度
     */
    private Integer dataLength;

    /**
     * 数据
     */
    private byte[] data;

	/**
	 * 客户端标识
	 */
	private String clientId;

	/**
	 * 防止数据过长
	 */

    private byte[] lastByte;
    private int resetLength;

    public MessageDto() {

    }

    public MessageDto(int sn, Short cmd, String clientId, byte[] data) {
        this.sn = sn;
        this.cmd = cmd;
        this.data = data;
        this.clientId = clientId;
        this.dataLength = data == null ? 0 : data.length;
    }

    public byte[] getHeader() {
        return header;
    }

    public void setHeader(byte[] header) {
        this.header = header;
    }

    public int getSn() {
        return sn;
    }

    public void setSn(int sn) {
        this.sn = sn;
    }

    public short getCmd() {
        return cmd;
    }

    public void setCmd(short cmd) {
        this.cmd = cmd;
    }

    public Integer getDataLength() {
        return dataLength;
    }

    public void setDataLength(Integer dataLength) {
        this.dataLength = dataLength;
    }

    public byte[] getData() {
        return data;
    }

    public void setData(byte[] data) {
        this.data = data;
    }

	public String getClientId() {
		return clientId;
	}

	public void setClientId(String clientId) {
		this.clientId = clientId;
	}

    public byte[] getLastByte() {
        return lastByte;
    }

    public void setLastByte(byte[] lastByte) {
        this.lastByte = lastByte;
    }

    public int getResetLength() {
		return resetLength;
	}

	public void setResetLength(int resetLength) {
		this.resetLength = resetLength;
	}
}
